package model

// 用于节约重复代码
type StorageMap map[string]*Storage

// map加载方法
func (sm StorageMap) InitStorageMap(storageArray []*Storage) {
	for _, storage := range storageArray {
		sm[storage.StorageKey] = storage
	}
}

// GetKeys
func (m StorageMap) GetKeys() (keys []string) {
	keys = make([]string, 0, len(m))
	for key := range m {
		keys = append(keys, key)
	}
	return
}
